﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework;

namespace ThisIsTheOnlyChamber
{
    public abstract class GameState : Microsoft.Xna.Framework.DrawableGameComponent
    {
        public GameState(Game g) : base(g) { base.Initialize(); }

        private List<ISubscriber> subscribers = new List<ISubscriber>();
        protected void PublishMessage(Message M)
        {
            foreach (ISubscriber s in subscribers)
                s.RecieveMessage(M);
        }

        public void Subscribe(ISubscriber s)
        {
            subscribers.Add(s);
        }

        public abstract void ProcessGamePad(GamePadState gs);
        public abstract void ProcessKeyboardMouse(KeyboardState ks, MouseState ms);

        public void ReloadContent()
        {
            LoadContent();
        }
    }
}
